/*
 *************************************************************************
 * The contents of this file are subject to the Openbravo  Public  License
 * Version  1.0  (the  "License"),  being   the  Mozilla   Public  License
 * Version 1.1  with a permitted attribution clause; you may not  use this
 * file except in compliance with the License. You  may  obtain  a copy of
 * the License at http://www.openbravo.com/legal/license.html 
 * Software distributed under the License  is  distributed  on  an "AS IS"
 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
 * License for the specific  language  governing  rights  and  limitations
 * under the License. 
 * The Original Code is Openbravo ERP. 
 * The Initial Developer of the Original Code is Openbravo SL 
 * All portions are Copyright (C) 2001-2008 Openbravo SL 
 * All Rights Reserved. 
 * Contributor(s):  ______________________________________.
 ************************************************************************
*/

package org.openbravo.furniture.form;

import java.io.IOException; 
import java.io.PrintWriter; 
import java.math.BigDecimal; 
import java.sql.Connection; 
import java.util.StringTokenizer; 
import java.sql.SQLException;  
import javax.servlet.ServletConfig; 
import javax.servlet.ServletException; 
import javax.servlet.http.HttpServletRequest; 
import javax.servlet.http.HttpServletResponse; 

import org.openbravo.erpCommon.utility.OBError;
import org.openbravo.erpCommon.utility.ToolBar;
import org.openbravo.erpCommon.utility.Utility;

import org.openbravo.erpCommon.utility.SequenceIdData;
import org.openbravo.erpCommon.utility.*;
import org.openbravo.erpCommon.businessUtility.WindowTabs;
import org.openbravo.erpCommon.businessUtility.Tree;
import org.openbravo.base.secureApp.HttpSecureAppServlet;
import org.openbravo.base.secureApp.VariablesSecureApp;
import org.openbravo.xmlEngine.XmlDocument;
import org.openbravo.erpCommon.utility.ComboTableData;

// imports for transactions

import org.openbravo.dal.core.OBContext;
import org.openbravo.dal.service.OBCriteria;
import org.openbravo.dal.service.OBDal;
import org.openbravo.erpCommon.ad_forms.*;
import org.openbravo.model.ad.module.Module;
import org.openbravo.model.ad.system.System;
import org.openbravo.model.ad.system.SystemInformation;
import org.openbravo.erpCommon.obps.ActivationKey;
import org.openbravo.erpCommon.obps.ActiveInstanceProcess;

import java.util.Enumeration;
import java.util.Vector;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.openbravo.erpCommon.utility.DateTimeData;


public class Agenda extends HttpSecureAppServlet {
  private static final long serialVersionUID = 1L;



  public void doPost (HttpServletRequest request, HttpServletResponse response) throws IOException,ServletException {
    VariablesSecureApp vars = new VariablesSecureApp(request);
    

    if (vars.commandIn("DEFAULT")) {
      String strDateFrom = vars.getGlobalVariable("inpDateFrom", "Agenda|DateFrom", "");
      String strAD_Org_ID = vars.getGlobalVariable("inpadOrgId", "Agenda|AD_Org_ID", vars.getOrg());
	  String strTruckID = vars.getGlobalVariable("inptruckId", "Agenda|TruckID", "");
      vars.setSessionValue("Agenda.DateFrom", strDateFrom);
      printPageDataSheet(response, vars, strAD_Org_ID, strDateFrom, strTruckID);
    } else if (vars.commandIn("SELECTOR")) {
		String strDateFrom = vars.getGlobalVariable("inpDateFrom", "Agenda|DateFrom", "");
		vars.setSessionValue("Agenda.DateFrom", strDateFrom);
      String strHourDay= vars.getStringParameter("inpProcessId", "");
	  String strTruckID = vars.getStringParameter("inptruckId", "");
      printPageSelector(response, vars, strHourDay,strTruckID);
    } else if (vars.commandIn("SELECTOR2")) {
		String strDateFrom = vars.getGlobalVariable("inpDateFrom", "Agenda|DateFrom", "");
		vars.setSessionValue("Agenda.DateFrom", strDateFrom);
      String strPlanif= vars.getStringParameter("inpProcessId", "");
	  String strTruckID = vars.getStringParameter("inptruckId", "");
      printPageSelector2(response, vars, strPlanif,strTruckID);
    } else if (vars.commandIn("FIND")) {
      String strDateFrom = vars.getRequestGlobalVariable("inpDateFrom", "Agenda|DateFrom");
      String strAD_Org_ID = vars.getGlobalVariable("inpadOrgId", "Agenda|AD_Org_ID");
	  String strTruckID = vars.getStringParameter("inptruckId", "");
      vars.setSessionValue("Agenda.DateFrom", strDateFrom);
      printPageDataSheet(response, vars, strAD_Org_ID, strDateFrom,strTruckID);
    } else if (vars.commandIn("PREV_WEEK")) {
      String strDateFrom =  vars.getSessionValue("Agenda.DateFrom");
      strDateFrom = DateTimeData.nDaysAfter(this,strDateFrom,"-7");
      vars.setSessionValue("Agenda.DateFrom", strDateFrom);
      String strAD_Org_ID = vars.getGlobalVariable("inpadOrgId", "Agenda|AD_Org_ID");
	  String strTruckID = vars.getStringParameter("inptruckId", "");
      printPageDataSheet(response, vars, strAD_Org_ID, strDateFrom,strTruckID);
    } else if (vars.commandIn("NEXT_WEEK")) {
      String strDateFrom =  vars.getSessionValue("Agenda.DateFrom");
      strDateFrom = DateTimeData.nDaysAfter(this,strDateFrom,"7");
      vars.setSessionValue("Agenda.DateFrom", strDateFrom);
      String strAD_Org_ID = vars.getGlobalVariable("inpadOrgId", "Agenda|AD_Org_ID");
	  String strTruckID = vars.getStringParameter("inptruckId", "");
      printPageDataSheet(response, vars, strAD_Org_ID, strDateFrom,strTruckID);
    } else if (vars.commandIn("SAVE")) {
      String strTruckId = vars.getStringParameter("inptruckId");
      String strOrderId = vars.getStringParameter("inpOrder");
      String strDay = vars.getStringParameter("inpDateFrom");
      String strHourIni = vars.getStringParameter("inpHourIni");
      String strHourFin = vars.getStringParameter("inpHourFin");
      String strComplete = vars.getStringParameter("inpComplete");
	  String strAD_Org_ID = vars.getGlobalVariable("inpadOrgId", "Agenda|AD_Org_ID");
	  OBError myError = processAgenda(vars,strAD_Org_ID, strTruckId,strOrderId,strDay,strHourIni,strHourFin,strComplete);
	  vars.setMessage("Agenda", myError);
      vars.setSessionValue("Agenda.DateFrom", strDay);
	  vars.setSessionValue("Agenda.TruckID", strTruckId);
	  String strWindowPath = "";       
	  if (strWindowPath.equals(""))         
		  strWindowPath = strDefaultServlet; 
		printPageClosePopUpAndRefreshParent(response, vars);
   
    } else if (vars.commandIn("DELETE")) {
      String strTruckId = vars.getStringParameter("inptruckId");
	  String strpecPlanId = vars.getStringParameter("inpPecPlanif");
      String strOrderId = vars.getStringParameter("inpOrder");
      String strDay = vars.getStringParameter("inpDateFrom");
      String strHourIni = vars.getStringParameter("inpHourIni");
      String strHourFin = vars.getStringParameter("inpHourFin");
      String strComplete = vars.getStringParameter("inpComplete");
	  String strAD_Org_ID = vars.getGlobalVariable("inpadOrgId", "Agenda|AD_Org_ID");
	  OBError myError = deleteAgenda(vars,strpecPlanId);
	  vars.setMessage("Agenda", myError);
      vars.setSessionValue("Agenda.DateFrom", strDay);
	  vars.setSessionValue("Agenda.TruckID", strTruckId);
	  String strWindowPath = "";       
	  if (strWindowPath.equals(""))         
		  strWindowPath = strDefaultServlet; 
		printPageClosePopUpAndRefreshParent(response, vars);
   
    } else if (vars.commandIn("UPDATE")) {
      String strTruckId = vars.getStringParameter("inptruckId");
	  String strpecPlanId = vars.getStringParameter("inpPecPlanif");
      String strOrderId = vars.getStringParameter("inpOrder");
      String strDay = vars.getStringParameter("inpDateFrom");
      String strHourIni = vars.getStringParameter("inpHourIni");
      String strHourFin = vars.getStringParameter("inpHourFin");
      String strComplete = vars.getStringParameter("inpComplete");
	  String strAD_Org_ID = vars.getGlobalVariable("inpadOrgId", "Agenda|AD_Org_ID");
	  OBError myError = updateAgenda(vars,strAD_Org_ID, strTruckId,strOrderId,strDay,strHourIni,strHourFin,strComplete,strpecPlanId);
	  vars.setMessage("Agenda", myError);
      vars.setSessionValue("Agenda.DateFrom", strDay);
	  vars.setSessionValue("Agenda.TruckID", strTruckId);
	  String strWindowPath = "";       
	  if (strWindowPath.equals(""))         
		  strWindowPath = strDefaultServlet; 
		printPageClosePopUpAndRefreshParent(response, vars);
   
    } else pageError(response);
}


  void printPageDataSheet(HttpServletResponse response, VariablesSecureApp vars, String strAD_Org_ID, String strDateFrom, String strTruckID)
      throws IOException, ServletException {
      if (log4j.isDebugEnabled()) log4j.debug("Output: dataSheet");
      response.setContentType("text/html; charset=UTF-8");
      PrintWriter out = response.getWriter();
      String discard[]={"discard", "discard"};
      XmlDocument xmlDocument=null;
      
		AgendaData[] data=null;
		AgendaData[] dataHours=null;
		AgendaData[] dataAgenda=null;
		AgendaData[] dataPlanif=null;
		AgendaData[] dataOrders=null;

      xmlDocument = xmlEngine.readXmlTemplate("org/openbravo/furniture/form/Agenda", discard).createXmlDocument();
	if (strDateFrom==null || strDateFrom.equals("")) {
	strDateFrom=AgendaData.selectToday(this);
	vars.setSessionValue("Agenda.DateFrom", strDateFrom);
	}
      data = AgendaData.selectDays(this, strDateFrom);
	  dataHours = AgendaData.selectHours(this);

	  
      dataAgenda = AgendaData.selectAgenda(this, strDateFrom);

	  String strTruckDefault =  "";
	  if (strTruckID == null || strTruckID.equals(""))
	  {
			strTruckDefault =AgendaData.selectTruckDefault(this,vars.getClient());
	  } else strTruckDefault = strTruckID;

	  dataPlanif= AgendaData.selectPlanif(this,  data[0].datefrom, data[6].datefrom, strTruckDefault);
	  dataOrders = AgendaData.selectOrders(this);

		String strFirstDay =  AgendaData.selectFirstDay(this, strDateFrom);
		String strLastDay  =  AgendaData.selectLastDay(this, strDateFrom);


      ToolBar toolbar = new ToolBar(this, vars.getLanguage(), "Agenda", false, "", "", "",false, "ad_forms",  strReplaceWith, false,  true);
      toolbar.prepareSimpleToolBarTemplate();
      xmlDocument.setParameter("toolbar", toolbar.toString());


	 xmlDocument.setParameter("directory", "var baseDirectory = \"" + strReplaceWith + "/\";\n");
    xmlDocument.setParameter("language", "defaultLang=\"" + vars.getLanguage() + "\";");


    try {
      WindowTabs tabs = new WindowTabs(this, vars,"org.openbravo.furniture.form.Agenda");
      xmlDocument.setParameter("theme", vars.getTheme());
      NavigationBar nav = new NavigationBar(this, vars.getLanguage(), "Agenda.html",
          classInfo.id, classInfo.type, strReplaceWith, tabs.breadcrumb());
      xmlDocument.setParameter("navigationBar", nav.toString());
      LeftTabsBar lBar = new LeftTabsBar(this, vars.getLanguage(), "Agenda.html",
          strReplaceWith);
      xmlDocument.setParameter("leftTabs", lBar.manualTemplate());
    } catch (Exception ex) {
      throw new ServletException(ex);
    }



    {
      OBError myMessage = vars.getMessage("Agenda");
      vars.removeMessage("Agenda");

      if (myMessage!=null) {
        xmlDocument.setParameter("messageType", myMessage.getType());
        xmlDocument.setParameter("messageTitle", myMessage.getTitle());
        xmlDocument.setParameter("messageMessage", myMessage.getMessage());
      }
    }

    xmlDocument.setParameter("calendar", vars.getLanguage().substring(0,2));
    xmlDocument.setParameter("paramAdOrgId", strAD_Org_ID);
    xmlDocument.setParameter("dateFrom", strDateFrom);
    xmlDocument.setParameter("firstDay", strFirstDay);	 
	xmlDocument.setParameter("lastDay", strLastDay);	 
    xmlDocument.setParameter("dateFromdisplayFormat", vars.getSessionValue("#AD_SqlDateFormat"));
    xmlDocument.setParameter("dateFromsaveFormat", vars.getSessionValue("#AD_SqlDateFormat"));
    


    AgendaData[] truckData = AgendaData.selecttruck(this, vars.getClient());
	xmlDocument.setParameter("truckdefault", strTruckDefault);
	xmlDocument.setData("truck", truckData);


    xmlDocument.setData("structure1", data);
	xmlDocument.setData("structure3", dataHours);
	xmlDocument.setData("structure2", dataAgenda);
	xmlDocument.setData("structure4", dataPlanif);
	xmlDocument.setData("structure5", dataOrders);
//	xmlDocument.setDataArray("reportAgendaCell","structure3", dataCell);
        out.println(xmlDocument.print());
        out.close();
      }

  private void printPageSelector(HttpServletResponse response, VariablesSecureApp vars, String strHourDay, String strTruckID)
      throws IOException, ServletException {

    response.setContentType("text/html; charset=UTF-8");
 
String strDateFrom = strHourDay.substring(0, 10);
String strHour = strHourDay.substring(11, 19);

    final PrintWriter out = response.getWriter();
    final XmlDocument xmlDocument = xmlEngine.readXmlTemplate("org/openbravo/furniture/form/AgendaPopup").createXmlDocument();
    xmlDocument.setParameter("directory", "var baseDirectory = \"" + strReplaceWith + "/\";\n");
    xmlDocument.setParameter("language", "defaultLang=\"" + vars.getLanguage() + "\";");
    // Interface parameters
    final ToolBar toolbar = new ToolBar(this, vars.getLanguage(), "Agenda", false, "",
        "", "", false, "ad_forms", strReplaceWith, false, true);
    toolbar.prepareSimpleToolBarTemplate();
    xmlDocument.setParameter("toolbar", toolbar.toString());

    try {
      final WindowTabs tabs = new WindowTabs(this, vars,
          "org.openbravo.furniture.form.Agenda");
      xmlDocument.setParameter("theme", vars.getTheme());
      final NavigationBar nav = new NavigationBar(this, vars.getLanguage(),
          "Agenda.html", classInfo.id, classInfo.type, strReplaceWith,
          tabs.breadcrumb());
      xmlDocument.setParameter("navigationBar", nav.toString());
      final LeftTabsBar lBar = new LeftTabsBar(this, vars.getLanguage(), "Agenda.html",
          strReplaceWith);
      xmlDocument.setParameter("leftTabs", lBar.manualTemplate());
    } catch (final Exception ex) {
      throw new ServletException(ex);
    }

    // Message
    {
      final OBError myMessage = vars.getMessage("Agenda");
      vars.removeMessage("Agenda");
      if (myMessage != null) {
        xmlDocument.setParameter("messageType", myMessage.getType());
        xmlDocument.setParameter("messageTitle", myMessage.getTitle());
        xmlDocument.setParameter("messageMessage", myMessage.getMessage());
      }
    }

	AgendaData[] hoursData = AgendaData.selectHoursCombo(this);
	String strHourIni_ID =  AgendaData.selectHourIni(this,strHour);
	String strHourFin_ID =  AgendaData.selectHourFin(this,strHour);


	AgendaData[] dataOrders = AgendaData.selectOrdersCombo(this);

	xmlDocument.setParameter("hourini", strHourIni_ID);
	xmlDocument.setParameter("hourfin", strHourFin_ID);

	xmlDocument.setData("hourini", hoursData);
	xmlDocument.setData("hourfin", hoursData);

    xmlDocument.setParameter("dateFrom", strDateFrom);
    xmlDocument.setParameter("dateFromdisplayFormat", vars.getSessionValue("#AD_SqlDateFormat"));
    xmlDocument.setParameter("dateFromsaveFormat", vars.getSessionValue("#AD_SqlDateFormat"));
	        
	xmlDocument.setParameter("day", strHourDay);
    xmlDocument.setParameter("hour", strHourDay);

	String truckName = AgendaData.selecttruckname(this, strTruckID);
	xmlDocument.setParameter("truckdefault", strTruckID);
	xmlDocument.setParameter("truckdefaultname", truckName);
	xmlDocument.setData("structureorders", dataOrders);


    out.println(xmlDocument.print());
    out.close();
  }

  private void printPageSelector2(HttpServletResponse response, VariablesSecureApp vars, String strPlanif, String strTruckID)
      throws IOException, ServletException {

    response.setContentType("text/html; charset=UTF-8");


	String strPlanifId = strPlanif.substring(0, 32);
	String strDateFrom = AgendaData.selectDatePlanif(this, strPlanifId);
	String strHourIni_ID= AgendaData.selectHourIniPlanif(this, strPlanifId);
	String strHourFin_ID = AgendaData.selectHourFinPlanif(this, strPlanifId);
	String strOrderId = AgendaData.selectOrderId(this, strPlanifId);
	String strTruck = AgendaData.selectTruckId(this, strPlanifId);
	String strIscompleted = AgendaData.selectIscomplete(this, strPlanifId);
	
    final PrintWriter out = response.getWriter();
    final XmlDocument xmlDocument = xmlEngine.readXmlTemplate("org/openbravo/furniture/form/AgendaPopup2").createXmlDocument();
    xmlDocument.setParameter("directory", "var baseDirectory = \"" + strReplaceWith + "/\";\n");
    xmlDocument.setParameter("language", "defaultLang=\"" + vars.getLanguage() + "\";");
    // Interface parameters
    final ToolBar toolbar = new ToolBar(this, vars.getLanguage(), "Agenda", false, "",
        "", "", false, "ad_forms", strReplaceWith, false, true);
    toolbar.prepareSimpleToolBarTemplate();
    xmlDocument.setParameter("toolbar", toolbar.toString());

    try {
      final WindowTabs tabs = new WindowTabs(this, vars,
          "org.openbravo.furniture.form.Agenda");
      xmlDocument.setParameter("theme", vars.getTheme());
      final NavigationBar nav = new NavigationBar(this, vars.getLanguage(),
          "Agenda.html", classInfo.id, classInfo.type, strReplaceWith,
          tabs.breadcrumb());
      xmlDocument.setParameter("navigationBar", nav.toString());
      final LeftTabsBar lBar = new LeftTabsBar(this, vars.getLanguage(), "Agenda.html",
          strReplaceWith);
      xmlDocument.setParameter("leftTabs", lBar.manualTemplate());
    } catch (final Exception ex) {
      throw new ServletException(ex);
    }

    // Message
    {
      final OBError myMessage = vars.getMessage("Agenda");
      vars.removeMessage("Agenda");
      if (myMessage != null) {
        xmlDocument.setParameter("messageType", myMessage.getType());
        xmlDocument.setParameter("messageTitle", myMessage.getTitle());
        xmlDocument.setParameter("messageMessage", myMessage.getMessage());
      }
    }

	AgendaData[] hoursData = AgendaData.selectHoursCombo(this);



	AgendaData[] dataOrders = AgendaData.selectOrdersCombo(this);

	xmlDocument.setParameter("hourini", strHourIni_ID);
	xmlDocument.setParameter("hourfin", strHourFin_ID);
	xmlDocument.setParameter("order", strOrderId);

	xmlDocument.setData("hourini", hoursData);
	xmlDocument.setData("hourfin", hoursData);

    xmlDocument.setParameter("dateFrom", strDateFrom);
    xmlDocument.setParameter("dateFromdisplayFormat", vars.getSessionValue("#AD_SqlDateFormat"));
    xmlDocument.setParameter("dateFromsaveFormat", vars.getSessionValue("#AD_SqlDateFormat"));
	        
	xmlDocument.setParameter("pecPlanif", strPlanifId);


	String truckName = AgendaData.selecttruckname(this, strTruckID);
	xmlDocument.setParameter("truckdefault", strTruckID);
	xmlDocument.setParameter("truckdefaultname", truckName);

	xmlDocument.setParameter("orderid", strOrderId);
	String ordername = AgendaData.selectordername(this, strOrderId);
	xmlDocument.setParameter("ordername", ordername);
	xmlDocument.setParameter("ordernametitle", ordername);
	xmlDocument.setParameter("iscompleted", ("".equals(strIscompleted)) ? "N" : strIscompleted);
    out.println(xmlDocument.print());
    out.close();
  }



   private OBError  processAgenda(VariablesSecureApp vars, String strAD_Org_ID, String strTruckId, String strOrderId, String strDay, String strHourIni, String strHourFin, String strComplete) throws IOException, ServletException {

 int i = 0;     
 OBError myMessage = null;     
 StringBuffer txtOrder = new StringBuffer();     
 Connection conn = null;   
	try {
      	conn = getTransactionConnection();
		
		String strPlanOrderId = SequenceIdData.getUUID();
		String strOrgId= AgendaData.selectOrderOrg(this,strOrderId);
		if (strComplete== null || strComplete.equals(""))
		{
			strComplete="N";
		}
		AgendaData.insert(conn, this, strPlanOrderId, vars.getClient(), strOrgId, vars.getUser(), strOrderId, strTruckId,strDay,strHourIni,strHourFin,strComplete);          
 		releaseCommitConnection(conn);
	}  catch (Exception ex) {         
		myMessage = Utility.translateError(this, vars, vars.getLanguage(), ex.getMessage());     
		try {         
			releaseRollbackConnection(conn);       
			} catch (Exception ignored) {       
			} 
		return myMessage;      
    	}

		myMessage = new OBError();    
		myMessage.setType("Success");     
		myMessage.setTitle(Utility.messageBD(this, "Success", vars.getLanguage()));     
		myMessage.setMessage(Utility.messageBD(this, "RecordsCopied", vars.getLanguage()) + " " + 1);     
		return myMessage; 
   
}

   private OBError  deleteAgenda(VariablesSecureApp vars, String strPecPlanif) throws IOException, ServletException {

 int i = 0;     
 OBError myMessage = null;     
 StringBuffer txtOrder = new StringBuffer();     
 Connection conn = null;   
	try {
      	conn = getTransactionConnection();
		
		
		AgendaData.delete(conn, this,strPecPlanif);          
 		releaseCommitConnection(conn);
	}  catch (Exception ex) {         
		myMessage = Utility.translateError(this, vars, vars.getLanguage(), ex.getMessage());     
		try {         
			releaseRollbackConnection(conn);       
			} catch (Exception ignored) {       
			} 
		return myMessage;      
    	}

		myMessage = new OBError();    
		myMessage.setType("Success");     
		myMessage.setTitle(Utility.messageBD(this, "Success", vars.getLanguage()));     
		myMessage.setMessage(1 + " " + Utility.messageBD(this, "RowsDeleted", vars.getLanguage()));     
		return myMessage; 
   
}   


private OBError  updateAgenda(VariablesSecureApp vars, String strAD_Org_ID, String strTruckId, String strOrderId, String strDay, String strHourIni, String strHourFin, String strComplete, String strPecPlanif) throws IOException, ServletException {

 int i = 0;     
 OBError myMessage = null;     
 StringBuffer txtOrder = new StringBuffer();     
 Connection conn = null;   
	try {
      	conn = getTransactionConnection();
		
		String strOrgId= AgendaData.selectOrderOrg(this,strOrderId);
		if (strComplete== null || strComplete.equals(""))
		{
			strComplete="N";
		}
		AgendaData.update(conn, this, vars.getUser(),strDay,strHourIni,strHourFin,strComplete,strPecPlanif);          
 		releaseCommitConnection(conn);
	}  catch (Exception ex) {         
		myMessage = Utility.translateError(this, vars, vars.getLanguage(), ex.getMessage());     
		try {         
			releaseRollbackConnection(conn);       
			} catch (Exception ignored) {       
			} 
		return myMessage;      
    	}

		myMessage = new OBError();    
		myMessage.setType("Success");     
		myMessage.setTitle(Utility.messageBD(this, "Success", vars.getLanguage()));     
		myMessage.setMessage(1 + " " + Utility.messageBD(this, "RowsUpdated", vars.getLanguage()));     
		return myMessage; 
   
}


  public String getServletInfo() {
    return "Agenda Servlet. This Servlet was made by Javier Frances";
  } // end of getServletInfo() method
}

